<%--
  Created by IntelliJ IDEA.
  User: QiangweiLuo
  Date: 12/21/2018
  Time: 10:39 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>参与投票</title>
    <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/css/style.css" />
</head>
<body>
<%@include file="top.jsp"%>

    <div id="vote" class="wrap" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc4-6" data-genuitec-path="/vote/WebRoot/WEB-INF/pages/vote.jsp">
        <h2>参与投票</h2>
        <ul class="list">
            <li>
                <h4>${subject.title}</h4>
                <p class="info">共有${subject.numberView}个选项，已有${subject.count}个网友参与了投票。</p>
                <form method="post" action="${pageContext.request.contextPath}/list/vote?method=vote">
                    <input type="hidden" name="subjectId" value="${subject.id}"/>
                    <ol>
                        <c:if test="${subject.number == 1}">
                            <c:forEach items="${subject.options}" var="option">
                                <li><input type="radio" name="options" value="${option.id}"/>${option.content}</li>
                            </c:forEach>
                        </c:if>
                        <c:if test="${subject.number == 2}">
                            <c:forEach items="${subject.options}" var="option">
                                <li><input type="checkbox" name="options" value="${option.id}"/>${option.content}</li>
                            </c:forEach>
                        </c:if>
                    </ol>
                    <p class="voteView">
                        <c:if test="${empty list}"><input type="image" src="${pageContext.request.contextPath}/images/button_vote.gif"></c:if>
                        <c:if test="${list != null}">您已投票: <c:forEach items="${list}" var="l">${l}　</c:forEach><br></c:if>
                        <a href="${pageContext.request.contextPath}/list/view?method=forward&id=${subject.id}"><img src="${pageContext.request.contextPath}/images/button_view.gif"></a>
                    </p>
                </form>
                <div class="error">${error}</div>


            </li>
        </ul>
    </div>
    <div id="footer" class="wrap">
        艾特优软件 &copy; 版权所有
    </div>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/heartbeat.js"></script>
</body>
</html>
